<?php
class Admin_Form_AddEvent extends Admin_Form_AddArticle {
	public function init() {
		$dataMaper 	= new M_Tool_DataMapper();

		$title 	 = new Zend_Form_Element_Text('title');
		$enTitle = new Zend_Form_Element_Text('en_title');

		$tbcountry = new M_DbTable_Country();
		$country   = new Zend_Form_Element_Select(
				'country_id',
                 array('label'        => 'Country',
                 	   'required'	 => true,
                 	   'RegisterInArrayValidator' => false,
                       'multiOptions' => $dataMaper->mapKeyValue(
	                       new M_DbTable_Country(),
	                       'id',
	                       'en_name',
	                       array('' => 'Country')
                        )
                 		));

		$startDate = new Zend_Form_Element_Text(
				'start_date',
				array('label' 		=> 'Start date',
					  'class'		=> 'input-medium datepicker'));

		$endDate = new Zend_Form_Element_Text(
				'end_date',
				array('label' 		=> 'End date',
					  'class'		=> 'input-medium datepicker'));

		$description = new Zend_Form_Element_Textarea(
				'description',
				array('label' 		=> 'Description'));

		$thumbnail = new Zend_Form_Element_File(
				'thumbnail',
				array('label' => 'Thumbnail'));

		$tbEvent = new M_DbTable_Event();
		$type = array(
		        $tbEvent::TYPE_GENERAL            => 'General Information',
		        $tbEvent::TYPE_INCENTIVE          => 'Incentives',
		        $tbEvent::TYPE_MEETING_CONFERENCE => 'Meetings & Conferences',
		        $tbEvent::TYPE_EVENT              => 'Events',
		        );
		$type 	  = new Zend_Form_Element_Select(
		        'type',
		        array('label'		 => 'Type',
	                  'multiOptions' => $type));

		$isComming 	  = new Zend_Form_Element_Select(
		        'is_comming',
		        array('label'		 => 'Is comming',
	                  'multiOptions' => array(0 => 'No', 1 => 'Yes')));
		
		$metaKeyWord = new Zend_Form_Element_Textarea(
				'meta_keyword',
				array('label' 		=> 'Meta keyword'));
		
		$metaDescription = new Zend_Form_Element_Textarea(
				'meta_description',
				array('label' 		=> 'Meta description'));
		$headerTitle = new Zend_Form_Element_Textarea(
				'header_title',
				array('label' 		=> 'Header title'));

		$this->addElement($enTitle)
			 ->addElement($title)
			 ->addElement($country)
			 ->addElement($type)
			 ->addElement($isComming)
			 ->addElement($thumbnail)
			 ->addElement($metaKeyWord)
			 ->addElement($metaDescription)
			 ->addElement($headerTitle);

		parent::init();

		$this->setLegend('Add New MICE');
		$this->addActionGroup()
			 ->makeup();
	}
}